Skip to content

perf(jetbrains): eliminate fixed waits from session tests - #11343

Merged
markijbema merged 3 commits into
mainfrom
perf/jetbrains-test-synchronization
Jun 17, 2026
Merged

perf(jetbrains): eliminate fixed waits from session tests#11343
markijbema merged 3 commits into
mainfrom
perf/jetbrains-test-synchronization

Conversation

@markijbema

Copy link
Copy Markdown
Contributor

Summary

Replace repeated fixed sleeps in JetBrains session test fixtures with deterministic FIFO coroutine barriers that continue draining the IntelliJ EDT. This preserves real background-thread and Swing behavior while avoiding the 500 ms minimum cost paid by nearly every controller and session UI synchronization point.

Batch header fixture and timeline events where intermediate states are irrelevant, while retaining per-token flush boundaries in the stream deduplication regression test. Test scopes now use dedicated background dispatchers and wait for cancellation before fixture teardown to keep synchronization deterministic and prevent work leaking between tests.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@kilo-code-bot

kilo-code-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionUiTestBase.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/controller/SessionControllerTestBase.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/controller/SessionUpdateQueueTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/header/SessionHeaderPanelTest.kt

Replaces fixed delay() sleeps with deterministic FIFO coroutine barriers using single-thread dispatchers. The await() helpers drain the dispatcher + EDT deterministically with 5-second timeout safety nets. Batching avoids unnecessary intermediate flushes; the stream dedup test retains per-token flush boundaries. tearDown() correctly cancels scope, awaits completion, and closes the dispatcher.


Reviewed by deepseek-v4-pro-20260423 · 271,528 tokens

Review guidance: REVIEW.md from base branch main

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@markijbema
markijbema enabled auto-merge June 17, 2026 12:25
@markijbema
markijbema merged commit f8052d9 into main Jun 17, 2026
20 of 21 checks passed
@markijbema
markijbema deleted the perf/jetbrains-test-synchronization branch June 17, 2026 12:26
NJ-2020 pushed a commit to NJ-2020/kilocode that referenced this pull request Jul 4, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…ynchronization

perf(jetbrains): eliminate fixed waits from session tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants